home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Adobe Graphics & Publishing SDK 1996 December
/
Adobe Graphics & Publishing SDK 1996 December.iso
/
pc
/
pm65sdk
/
sourcecode
/
includes
/
hcmplugs.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-18
|
16KB
|
409 lines
/************************************************************************************
* hcmplugs.h
* This file contains interfaces that plug-in writers can use to access
* HyperContent.
*
* Attempts are made here to indicate by parameter name whether it's an in,
* out, or inout parameter.
*
* Copyright: ⌐ 1996 by Adobe Systems, Inc., all rights reserved.
*
* $Revision: 1.5 $
*
*
************************************************************************************/
#if !defined( HCMPLUGS_H )
#define HCMPLUGS_H
/************************************************************************************
Dependent headers
************************************************************************************/
#if !defined( __PageMakerTypes__ )
#include "PMTypes.h"
#endif
//
// this project
//
#if !defined( HCMDEFS_H )
#include "hcmdefs.h"
#endif /* HCMDEFS_H */
#if !defined( HCMERRS_H )
#include "hcmerrs.h"
#endif /* HCMERRS_H */
#if !defined( HCMTYPES_H )
#include "hcmtypes.h"
#endif /* HCMTYPES_H */
/************************************************************************************
Forward declarations
************************************************************************************/
#if defined( __cplusplus )
class CHcmPlugInContentHandler;
#endif /* __cplusplus */
/************************************************************************************
Public types
************************************************************************************/
//
// CHandlerDeathProcPtr
//
// this is a notification proc used to informed registered clients of this
// interface that the CHcmContentHandler they have is now dead and gone. It's
// probably in your best interest to provide this function ptr at register time.
// This function may also be called on a thread which is why it's a one-way
// notification.
//
// Macintosh client note -- This function is called directly without going
// through the mixed mode manager via CallUniversalProc. This means that the
// function you provide must be native to the platform it's running on and
// not emulated (e.g. 68k running on a PowerPC).
//
#if defined( __cplusplus )
typedef void (*CHandlerDeathProcPtr)( CHcmPlugInContentHandler * inCHandlerPtr );
#endif /* __cplusplus */
//
// Bounding Box record
//
struct HcmBoundingBoxRec
{
HcmPmLocationEnum m_PageNumber;
#if defined( MACINTOSH )
Rect m_BoundingBox;
#else /* MACINTOSH */
RECT m_BoundingBox;
#endif /* MACINTOSH */
}; // HcmBoundingBoxRec
typedef struct HcmBoundingBoxRec HcmBoundingBoxRec;
//
// Bounding Box list header
//
struct HcmBoundingBoxHdrRec
{
UINT32 m_ElementCount;
HcmBoundingBoxRec * m_BoundingBoxRecPtr;
}; // HcmBoundingBoxHdrRec
typedef struct HcmBoundingBoxHdrRec HcmBoundingBoxHdrRec;
/************************************************************************************
Public __cplusplus definitions
************************************************************************************/
#if defined( __cplusplus )
//
// CHcmPlugInRegistry
//
// This is the object where clients come for contenthandler objects.
//
class CHcmPlugInRegistry
{
//
// public methods
//
public:
//
// content type client registry
//
// This is the member function that clients use to obtain
// content handler objects. Note the CHandlerDeathProcPtr
// parameter and it's importance -- see the note above.
//
virtual HcmErr ContentTypeRegister(
const HcmCallerIdEnum inUniqueCallerId,
const char * inContentTypePtr,
CHandlerDeathProcPtr inNotifyProcPtr,
CHcmPlugInContentHandler ** outCHandlerPtr ) = 0;
//
// un-registering of clients
//
// This is the member function that clients can use to dump
// the content handler object.
//
virtual HcmErr ContentTypeUnregister(
const HcmCallerIdEnum inUniqueCallerId,
const char * inContentTypePtr ) = 0;
}; /* class CHcmPlugInRegistry */
//
// CHcmPlugInContentHandler
//
// This is the object that clients use to talk to the HCM.
//
class CHcmPlugInContentHandler
{
//
// public methods
//
public:
//
// destroys the bounding box header record.
//
virtual void BoundingBoxHdrRecDestroy( HcmBoundingBoxHdrRec * inPtr ) = 0;
//
// use this to create an object
//
virtual HcmErr Create(
HcmObjectCreateDescRec * inObjectDescriptionPtr,
HcmObjectId * outCreatedObjectId ) = 0;
//
// use one of these to delete an object
//
virtual HcmErr Delete( const HcmObjectId inObjectId ) = 0;
virtual HcmErr Delete(
HcmPmUniqueRec * inObjectToDeletePtr,
HcmObjectTypeEnum inKindOfObject ) = 0;
//
// Destroys the buffer allocated by DisplayNameGet.
//
virtual HcmErr DisplayNameBufferDestroy(
char * inBufferPtr ) = 0;
//
// returns the display name, ASCII CString, of the indicated
// object into a buffer allocated by the caller.
//
virtual HcmErr DisplayNameGet(
const HcmObjectId inObjectId,
char ** outNamePtr ) = 0;
//
// sets the display name
//
virtual HcmErr DisplayNameSet(
const HcmObjectId inObjectId,
char * inNewNamePtr ) = 0;
//
// getting HcmObjectIds from other data
//
//
// by HcmPmUniqueRec. Since a PageMaker segment can be
// BOTH a hyperlink and an anchor OR simply just a storage-only
// object, this function needs 3 pointers to indicate the segment
// state via these IDs.
//
virtual HcmErr HcmObjectIdGet(
HcmPmUniqueRec * inPmUniqueRecPtr,
HcmObjectId * outAnchorObjectIdPtr,
HcmObjectId * outHyperlinkObjectIdPtr,
HcmObjectId * outStorageOnlyObjectIdPtr ) = 0;
//
// by display name (palette name)
//
virtual HcmErr HcmObjectIdGet(
char * inName,
HcmObjectId * outObjectId ) = 0;
//
// returns the Hcm-type of the indicated object.
//
virtual HcmErr HyperContentTypeGet(
const HcmObjectId inObjectId,
HcmObjectTypeEnum * outObjectType ) = 0;
//
// utility to determine kind of segment that data belongs to.
//
virtual HcmErr IsPmTextSegment(
const HcmObjectId inObjectId,
PMBool * outIsTextSegment ) = 0;
//
// determines if the passed in type is a valid anchor
//
virtual PMBool IsValidAnchorType( HcmObjectTypeEnum inType ) = 0;
//
// determines if the passed in type is a valid hyperlink
//
virtual PMBool IsValidHyperlinkType( HcmObjectTypeEnum inType ) = 0;
//
// determines if the passed in type is a valid StorageOnly
//
virtual PMBool IsValidStorageOnlyType( HcmObjectTypeEnum inType ) = 0;
//
// gets the pagemaker info of the indicated object.
//
virtual HcmErr PageMakerInfoGet(
const HcmObjectId inObjectId,
HcmPmUniqueRec * outPmUniqueRecPtr ) = 0;
//
// sets the pagemaker info of the indicated object.
//
virtual HcmErr PageMakerInfoSet(
const HcmObjectId inObjectId,
HcmPmUniqueRec * inPmUniqueRecPtr ) = 0;
//
// just returns the page number of the object.
//
virtual HcmErr PageMakerLocationGet(
const HcmObjectId inObjectId,
HcmPmLocationEnum * outLocation ) = 0;
//
// SIDE EFFECT -- To find out what page it's on, this
// code uses the Hypertext routine that jumps to the
// page.
//
virtual HcmErr PageMakerLocationGet(
const HcmObjectId inObjectId,
HcmPmLocationEnum * outLocation,
INT32 * outItemTop,
INT32 * outItemLeft ) = 0;
//
// Don't forget after calling this to destroy the bounding
// box record allocated to avoid a memory leak.
// Currently -- BoundingBoxHdrRecDestroy.
//
virtual HcmErr PageMakerLocationGet(
const HcmObjectId inObjectId,
HcmBoundingBoxHdrRec ** outBBoxHdrRecPtr ) = 0;
//
// this routine asks the HCM if inPmUniqueRecPtr says that there
// is anchor info attached to the pm object.
//
virtual PMBool PageMakerSegmentHasAnchorInfo(
HcmPmUniqueRec * inPmUniqueRecPtr ) = 0;
//
// this routine asks the HCM if inPmUniqueRecPtr says that there
// is hyperlink info attached to the pm object.
//
virtual PMBool PageMakerSegmentHasHyperlinkInfo(
HcmPmUniqueRec * inPmUniqueRecPtr ) = 0;
//
// this routine asks the HCM if inPmUniqueRecPtr says that there
// is StorageOnly info attached to the pm object.
//
virtual PMBool PageMakerSegmentHasStorageOnlyInfo(
HcmPmUniqueRec * inPmUniqueRecPtr ) = 0;
//
// determines if the passed segment has hypercontent
//
virtual PMBool PageMakerSegmentHasHyperContent(
HcmPmUniqueRec * inPmUniqueRecPtr ) = 0;
//
// caller allocates a buffer large enough to hold the
// data, this function fills it.
//
virtual HcmErr PrivateDataRead(
const HcmObjectId inObjectId,
char * outBuffer,
UINT32 * inoutHowMuchToRead ) = 0;
//
// returns the size of the objects data
//
virtual HcmErr PrivateDataSizeGet(
const HcmObjectId inObjectId,
UINT32 * outHowBig ) = 0;
//
// caller allocates a buffer large enough to hold the
// data, this function writes with it.
//
virtual HcmErr PrivateDataWrite(
const HcmObjectId inObjectId,
char * inBuffer,
UINT32 * inoutHowMuchToWrite ) = 0;
//
// caller allocates a buffer large enough to hold the
// data, this function fills it.
//
virtual HcmErr PubPrefsRead(
char * outBuffer,
UINT32 * inoutHowMuchToRead ) = 0;
//
// returns the size of the preference info
//
virtual HcmErr PubPrefsSizeGet( UINT32 * outHowBig ) = 0;
//
// caller allocates a buffer large enough to hold the
// data, this function writes with it.
//
virtual HcmErr PubPrefsWrite(
char * inBuffer,
UINT32 * inoutHowMuchToWrite ) = 0;
//
// how to break relationships.
//
virtual HcmErr RelationshipBreakAll( const HcmObjectId inSource ) = 0;
virtual HcmErr RelationshipBreakOne(
const HcmObjectId inSource,
const HcmObjectId inDestination ) = 0;
//
// This is called by clients to destroy the array allocated by
// RelationshipGet
//
virtual HcmErr RelationshipArrayDestroy(
HcmObjectId * inDestinationArray ) = 0;
//
// how to iterate relationships. Returns an array of
// HcmObjectIds that this item points to. Format is a
// count followed by the ids. Caller is responsible
// for calling RelationshipArrayDestroy on the array passed back.
//
virtual HcmErr RelationshipGet(
const HcmObjectId inSource,
HcmObjectId ** outDestinationArray ) = 0;
//
// how to iterate relationships. Returns an array of
// HcmObjectIds that this item points to. Format is a
// count followed by the ids. Caller is responsible
// for calling RelationshipArrayDestroy on the array passed back.
//
// This overridden function only looks up anchors.
//
virtual HcmErr RelationshipGet(
HcmPmUniqueRec * inPmUniqueRecPtr,
HcmObjectId ** outDestinationArray ) = 0;
//
// how to make relationships.
//
virtual HcmErr RelationshipMake(
const HcmObjectId inSource,
const HcmObjectId inDestination ) = 0;
}; /* class CHcmPlugInContentHandler */
#endif /* __cplusplus */
#endif /* HCMPLUGS_H */